﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <link type="text/css" rel="stylesheet" href="library/css/reset.css" />
    <link type="text/css" rel="stylesheet" href="library/css/smoothness/jquery-ui-1.9.1.custom.css" />
    <link type="text/css" rel="stylesheet" href="library/css/style.css" />
    
    <script language="javascript" type="text/javascript" src="library/js/jquery-1.8.2.min.js"></script>
    <script language="javascript" type="text/javascript" src="library/js/jquery-ui-1.9.1.custom.js"></script>

    <script language="javascript" type="text/javascript" src="library/js/QlikViewMashups.js"></script>

    <title></title>
    <script language="javascript" type="text/javascript">

        $(function () {

            if (IsOffline()) {

                loadJs(qvAjaxLib_Url, qvAjaxLoaded);

                function qvAjaxLoaded() {

                    var qvDoc;
                    var qvDoc2;

                    Init_Sales = function () {
                        //qvDoc = Qv.GetCurrentDocument();
                        qvDoc = Qv.GetDocument('Sales Compass');
                        qvDoc.Clear();
                    }
                    Init_WhatsNew = function () {
                        qvDoc2 = Qv.GetDocument('Whats New in QlikView11');
                        qvDoc2.Clear();
                    }

                    Qv.InitWorkBench({
                        View: ['Sales Compass'],
                        Host: null, // Instead of using "Host: 'Local'", use "Host: null"
                        BodyOnLoadFunctionNames: ['Init_Sales']
                    });

                    Qv.InitWorkBench({
                        View: ['Whats New in QlikView11'],
                        Host: null, // Instead of using "Host: 'Local'", use "Host: null"
                        BodyOnLoadFunctionNames: ['Init_WhatsNew']
                    });

                }
            }
            else {
                $("#divOutput").empty();
                $("#divOutput").html("<img src='library/images/DivIntegration_10.png'>");
                $("#divOutput").css('cursor', 'pointer');
                $("#divOutput").click(function () {
                    OfflineMsg();
                });
            }

        });

        // --
        

    </script>
    <style type="text/css">
    .QvInlineObject 
    {
        position:relative;
        margin-left:10px;
        margin-right:10px;
        float:left;
    }
    html 
    {
        overflow:hidden;
        padding:10px 10px 10px 10px;
    }
    </style>
</head>
<body>

        <h2 class="hidden" id="demo_title">Loading from Different QlikView Documents</h2>
        <div id="demo_description" class="hidden">
            This example loads two objects from <b>two different QlikView documents</b>:
            <ul>
                <li>Sales Pipeline from QlikView document "Sales Compass"</li>
                <li>Top Sales person Sales (K) from "Whats New in QlikView11"</li>
            </ul>
            
            <p>
            After loading the two documents the selections are cleared in both documents.<br />
            At this point you could for example also implement some other actions like selecting values, etc.
            </p>
        </div>

        <div id="divOutput">
            <div class="QvInlineObject" avqview="Sales Compass" avq="object:.Document\CH378"
                id="Document\CH378" style="height: 250px; width: 250px;">
            </div>
            <div class="QvInlineObject" avqview="Whats New in QlikView11" avq="object:.Document\CH04"
                id="Document\CH04" style="width: 300px; height: 250px;">
            </div>
        </div>

    <div id="demo_code_header" class="hidden">
        <p>
            Javascript code placed in the header of the Html file to initialize the QlikView-object(s).<br />
            Note: To get this to work you have call Qv.InitWorkBench twice.
        </p>
            <pre class="wrapped">
            &lt;script language="javascript" type="text/javascript"&gt;<br />
            &nbsp;&nbsp;&nbsp;var qvDoc;<br />
            &nbsp;&nbsp;&nbsp;var qvDoc2;<br />
                <br />
            &nbsp;&nbsp;&nbsp;Init_Sales = function () {<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qvDoc = Qv.GetDocument('Sales Compass');<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qvDoc.Clear();<br />
            &nbsp;&nbsp;&nbsp;}<br />
            &nbsp;&nbsp;&nbsp;Init_WhatsNew = function () {<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qvDoc2 = Qv.GetDocument('Whats New in QlikView11');<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;qvDoc2.Clear();<br />
            &nbsp;&nbsp;&nbsp;}<br />
                <br />
            &nbsp;&nbsp;&nbsp;Qv.InitWorkBench({<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;View: ['Sales Compass'],<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Host: null, // Instead of using "Host: 'Local'", use "Host: null"<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BodyOnLoadFunctionNames: ['Init_Sales']<br />
            &nbsp;&nbsp;&nbsp;});<br />
                <br />
            &nbsp;&nbsp;&nbsp;Qv.InitWorkBench({<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;View: ['Whats New in QlikView11'],<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Host: null, // Instead of using "Host: 'Local'", use "Host: null"<br />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;BodyOnLoadFunctionNames: ['Init_WhatsNew']<br />
            &nbsp;&nbsp;&nbsp;});<br />
            &lt;/script&gt;<br />
            </pre>
        </div>

        <div id="demo_code_css" class="hidden">
            <pre class="wrapped">
                .QvInlineObject<br /> 
                {<br />
                    &nbsp;&nbsp;&nbsp;position:relative;<br />
                    &nbsp;&nbsp;&nbsp;margin-left:10px;<br />
                    &nbsp;&nbsp;&nbsp;margin-right:10px;<br />
                    &nbsp;&nbsp;&nbsp;float:left;<br />
                }<br />
                </pre>
        </div>

        <div id="demo_code_body" class="hidden">
        <p>
        DIV blocks to place the QlikView objects within your webpage.
        </p>
        <div>
            <pre class="wrapped">
                &lt;div class="QvInlineObject" avqview="Sales Compass" avq="object:.Document\CH378"<br />
                &nbsp;&nbsp;&nbsp;id="Div1" style="height: 250px; width: 250px;"&gt;<br />
                &lt;/div&gt;<br />
                <br />
                &lt;div class="QvInlineObject" avqview="Whats New in QlikView11" avq="object:.Document\CH04"<br />
                &nbsp;&nbsp;&nbsp;id="Div2" style="width: 300px; height: 250px;"><br />
                &lt;/div&gt;<br />
            </pre>
        </div>
        </div>

</body>
</html>
